# 使用官方的轻量级Java运行时作为基础镜像
#FROM openjdk:11-jre-slim as base-image
FROM openjdk:8-jre AS base-image


# 设置工作目录
WORKDIR /app

# 将应用的JAR包复制到容器中
COPY target/java-k8s-app-demo-1.0-SNAPSHOT.jar ./java-k8s-app-demo-1.0-SNAPSHOT.jar

# 设置环境变量
ENV JAVA_OPTS=""

# 定义容器启动时执行的命令
ENTRYPOINT ["sh", "-c", "$JAVA_OPTS", "java -jar java-k8s-app-demo-1.0-SNAPSHOT.jar"]